provider
( service in module AUTO
)
Register a provider for a service. The providers can be retrieved and can have additional configuration methods.
name – {string} –
The name of the instance. NOTE: the provider will be available under name + 'Provider'
key.
provider – {(Object|function())} –
If the provider is:
Object
: then it should have a $get
method. The $get
method will be invoked using
$injector.invoke()
when an instance needs to be created.Constructor
: a new instance of the provider will be created using
$injector.instantiate()
, then treated as object
.{Object}
– registered provider instance